program CrossLines;

{$APPTYPE CONSOLE}
var
x, y : array of real;
n : integer;
xp, yp : real;
i, j, s : integer;
a1, a2, b1, b2, c1, c2 : real;
begin
  s := 0;
  readln(n);
  setlength(x, 2*n);
  setlength(y, 2*n);
  for i:=1 to 2*n-1 do
  begin
    if (i mod 2) <> 0 then
    begin
    readln(x[i], y[i], x[i+1], y[i+1]);
    end;
  end;
  for i:=1 to 2*n-1 do
    for j:=1 to 2*n-1 do
    begin
      if (i<j) and (i mod 2 <>0) and (j mod 2 <> 0) then
      begin
      a1 := y[i]-y[i+1];
      b1 := x[i+1]-x[i];
      a2 := y[j]-y[j+1];
      b2 := x[j+1]-x[j];
      c1 := x[i]*y[i+1]-x[i+1]*y[i];
      c2 := x[j]*y[j+1]-x[j+1]*y[j];
      if (a1*b2-b1*a2<>0) then
      begin
        xp := (c2*b1-c1*b2) / (a1*b2-b1*a2);
        yp := (c2*a1-c1*a2) / (a1*b2-b1*a2);
        s := s+1;
        writeln(s,' ',xp:0:2,' ',yp:0:2);
      end;
      end;
    end;
    writeln(s);
    readln;
end.
 